if, elseif, else, endif (OTF Keyword)

OTF Conditional statement block definition.

Syntax

%if condition1%
[true code text]
%elseif condition2%
[true code text]
%else%
[false code text]
%endif%

Remarks

Creates a condiotnal statement block that can dictate the flow and how code is generated based on the true condition. Also, conditions may not be nested. For example the following code will produce unexpected results:

%if value1 == value2%
[code text]
%if value3 != value4%
[code text]
%endif%
%endif%

Modifiers

(condition) Specifies the condition to evaluate. A condition can be a variable reference or object call. Conditions can only contain 1 single value comparison and are only evaluated either by equals or not equals (%if value1 = = value2%) or (%if value1 ! = value2%).

Operators

==, !=

Example

%rem Display a message indicating how many objects exist in the application%
%if APPLICATION.GetObjectCount == 0%
MsgBox "No objects defined in this Application"
%elseif APPLICATION.GetObjectCount == 1%
MsgBox "One object defined in this Application"
%else%
MsgBox "#APPLICATION.GetObjectCount# objects are defined in this Application"
%endif%

 

 

 


Copyright Information
 
Copyright ⌐ 1998-1999 Everett Ward Systems. All rights reserved.
Other products & companies referred to herein are trademarks or registered trademarks of their
respective companies or mark holders.